package com.gxedu.springenvironmentconfig.sourceloader;

import org.springframework.boot.env.PropertySourceLoader;
import org.springframework.core.env.PropertySource;
import org.springframework.core.io.Resource;

import java.io.File;
import java.io.IOException;
import java.util.List;

/**
 * @Auther: Liu_gx
 * @Date: 2021/2/1 10:42
 * @Description:
 */
public class MapProperySourceLocator implements PropertySourceLoader {
    @Override
    public String[] getFileExtensions() {
        return new String[]{"json","map"};
    }

    @Override
    public List<PropertySource<?>> load(String name, Resource resource) throws IOException {
        File file = resource.getFile();
        //拿到文件地址
        //解析文件
        //保存PropertySource
//        return new GpDefineJsonProperySource();
        return null;
    }
}
